type MainController struct {
    beego.Controller
}
func (c *MainController) Get() {
    c.Data["Website"] = "beego.me"
    c.Data["Email"] = "astaxie@gmail.com"
    c.TplName = "index.tpl"
}


func (c *MainController) Get(){
    //　这两行代码是返回json数据必须的两行，整个业务逻辑就是构造这个字典
    result := make(map[string]interface{})
    //　业务逻辑处理
    result["data"] = "hello word"
    c.Data["json"] = result
    c.ServeJSON()
}